package com.qdlc.p2p.dal.mybatis.model.mapper;

import java.util.List;

import com.qdlc.p2p.dal.model.ReceivingInfoModel;
import org.apache.ibatis.annotations.Param;

import com.qdlc.p2p.dal.dto.ReceivingInfo;


/**
 * 收货信息地址Mapper接口
 * @author linya
 */
public interface ReceivingInfoMapper {
    
	/**
	 * 根据Id查找
	 * @param id
	 * @return
	 */
	ReceivingInfo findById(long id);
	
	/**
	 * 解除默认
	 * @param userId
	 */
	void setUnDefultByUserId(long userId);
	
	/**
	 * 设置默认
	 * @param userId
	 */
	void setDefultByUserId(@Param("id")long id, @Param("userId")long userId);
	
	/**
	 * 禁用
	 * @param id
	 * @param userId
	 */
	void disable(@Param("id")long id, @Param("userId")long userId);
	
	/**
	 * 查询数据
	 * @param userId
	 * @param status
	 * @return
	 */
	List<ReceivingInfo> list(@Param("userId")long userId, @Param("status")int status);
	
	/**
	 * 统计数量
	 * @param userId
	 * @param status
	 * @return
	 */
	int count(@Param("userId")long userId, @Param("status")int status);

	/**
	 * 根据model查询数据
	 * @param receivingInfoModel
	 * @return
	 */
	List<ReceivingInfoModel> findByModel(ReceivingInfoModel receivingInfoModel);
}